<?php

namespace App\Http\Controllers\Index;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Resources\Index\Chart\OnlineResource;
use App\Http\Resources\Index\Chart\AmountResource;
use App\Http\Resources\Index\Chart\TransferResource;
use App\Http\Resources\Index\Chart\WalletResource;
use App\Services\Index\ChartService;

class ChartController extends Controller
{

    /**
     * 统计图【在线人数】
     */
    public function online(Request $request)
    {
        $datas = ChartService::make()->online($request);

        return OnlineResource::make($datas);
    }

    /**
     * 统计图【平台收益】
     */
    public function amount(Request $request)
    {
        $datas = ChartService::create()->amount($request);

        return AmountResource::make($datas);
    }

    /**
     * 统计图【手工订单】
     */
    public function transfer(Request $request)
    {
        $datas = ChartService::make()->transfer($request);

        return TransferResource::make($datas);
    }

    /**
     * 统计图【钱包订单】
     */
    public function wallet(Request $request)
    {
        $datas = ChartService::create()->wallet($request);

        return WalletResource::make($datas);
    }
}
